package com.csci;

import java.util.TreeMap;

public class KruskalGraph {

	TreeMap<KruskalEdge, Integer> treeMap;
	KruskalVertex[] vertex;
	KruskalEdge[] edge;
	
	public KruskalGraph(){
		vertex = new KruskalVertex[9];
		edge = new KruskalEdge[14];
	}
	
	public void initializeVertices() {
		char[] vertexLabel= {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'};
		for(int i = 0; i < vertex.length; i++){
			vertex[i] = new KruskalVertex(vertexLabel[i]);
		}
	}
	
	public void initializeEdges() {
		for(int i = 0; i < edge.length; i++){
			edge[i] =  new KruskalEdge();
		}
		
		edge[0].weight = 1;
		edge[0].u = vertex[7];//h
		edge[0].v = vertex[6];//g
			
		edge[1].weight = 2;
		edge[1].u = vertex[8];//i
		edge[1].v = vertex[2];//c
		
		edge[2].weight = 2;
		edge[2].u = vertex[6];//g
		edge[2].v = vertex[5];//f
		
		
		edge[3].weight = 4;
		edge[3].u = vertex[0];//a
		edge[3].v = vertex[1];//b
		
		edge[4].weight = 4;
		edge[4].u = vertex[2];//c
		edge[4].v = vertex[5];//f
		
		edge[5].weight = 6;
		edge[5].u = vertex[8];//i
		edge[5].v = vertex[6];//g
		
		edge[6].weight = 7;
		edge[6].u = vertex[2];//c
		edge[6].v = vertex[3];//d
		
		edge[7].weight = 7;
		edge[7].u = vertex[7];//h
		edge[7].v = vertex[8];//i
		
		
		edge[8].weight = 8;
		edge[8].u = vertex[0];//a
		edge[8].v = vertex[7];//h
		
		edge[9].weight = 8;
		edge[9].u = vertex[1];//b
		edge[9].v = vertex[2];//c
		
		edge[10].weight = 9;
		edge[10].u = vertex[3];//d
		edge[10].v = vertex[4];//e
		
		edge[11].weight = 10;
		edge[11].u = vertex[5];//f
		edge[11].v = vertex[4];//e
		
		edge[12].weight = 11;
		edge[12].u = vertex[1];//b
		edge[12].v = vertex[7];//h
		
		edge[13].weight = 14;
		edge[13].u = vertex[3];//d
		edge[13].v = vertex[5];//f
	}
}
